import layout from 'components/blankLayout/blankLayout.vue'
// 
const demo50files = require.context('./demo50', true, /\.js$/);
let demo50 = []
demo50files.keys().forEach((key) => {
    let module = demo50files(key)
    if (module.default && module.default.path) {
        demo50.push(module.default)
    }
})
demo50 = demo50.sort((a, b) => a.sortNo - b.sortNo)
console.log(demo50);
// 
const echartDemoFiles = require.context('./echartDemo', true, /\.js$/);
let echartDemo = [];
echartDemoFiles.keys().forEach((key) => {
    let module = echartDemoFiles(key)
    if (module.default && module.default.path) {
        echartDemo.push(module.default)
    }
})
echartDemo = echartDemo.sort((a, b) => a.sortNo - b.sortNo)

const route = [
    {
        path: '/fifty',
        component: layout,
        name: 'fifty',
        meta: {
            title: 'demo50'
        },
        children: demo50
    },
    {
        path: '/echartDemo',
        component: layout,
        name: 'echartDemo',
        meta: {
            title: 'echartDemo'
        },
        children: echartDemo
    }
];

route.forEach(item => {
    item.children.forEach(it => {
        it.path = `${item.path}/${it.path}`;
    });
});
export default route;